package com.comprehensive.dataservice.feign;

import com.comprehensive.common.dto.PageResponse;
import com.comprehensive.dataservice.entity.Novel;
import com.comprehensive.dataservice.entity.NovelChapter;
import org.springframework.web.bind.annotation.*;

import java.util.List;

//@FeignClient(name = "data-access-service")
interface NovelFeignClient {
    @GetMapping("/novel/listPage")
    PageResponse<Novel> listPage(
            @RequestParam(defaultValue = "0") int pageNum,
            @RequestParam(defaultValue = "10") int pageSize
    ) ;
    @GetMapping("/novel/{id}")
    Novel queryById(@PathVariable String id);
    @PostMapping("/novel")
    void save(@RequestBody Novel novel);
    @PutMapping("/novel")
    void update(@RequestBody Novel novel) ;
    @DeleteMapping("/novel/{id}")
    void delete(@PathVariable String id) ;

    @GetMapping("/novel/chapter/listPage")
    PageResponse<NovelChapter> listChapterPage(
            @RequestParam(defaultValue = "0") int pageNum,
            @RequestParam(defaultValue = "10") int pageSize,
            @RequestParam String novelId
    ) ;
    @GetMapping("/novel/chapter/list")
    List<NovelChapter> listChapter(@RequestParam String novelId);
    @GetMapping("/novel/chapter/{id}")
    NovelChapter queryChapterById(@PathVariable String id);
    @PostMapping("/novel/chapter")
    void saveChapter(@RequestBody NovelChapter novelChapter);
    @PutMapping("/novel/chapter")
    void updateChapter(@RequestBody NovelChapter novelChapter);
    @DeleteMapping("/novel/chapter/{id}")
    void deleteChapter(@PathVariable String id) ;
}
